package com.otp.webapp.comparators;

import java.util.Comparator;
import com.otp.model.test.template.Item;

public class CompItemsByOrderInSection implements Comparator<Item>{

	//@Override
	public int compare(Item i1, Item i2){
		int orderSection1 = (int) (long) i1.getTestSection().getOrderInTest();
		int orderSection2 = (int) (long) i2.getTestSection().getOrderInTest();
		if(orderSection1!=orderSection2) return orderSection1-orderSection2;
		
		int orderItem1 = i1.getOrderInSection();
		int orderItem2 = i2.getOrderInSection();
		return orderItem1-orderItem2;
	}

}
